package websocket.app.messaging;

import javax.websocket.RemoteEndpoint.Async;

public class TimerMessageListener implements MessageListener {
    
    private Async remotePeer;
    private String sessionId;
    
    public TimerMessageListener(String sessionId, Async remotePeer) {
	this.sessionId = sessionId;
	this.remotePeer = remotePeer;
    }
    
    @Override
    public void onMessage(Message message) {
	remotePeer.sendText(message.toString());// this call is asynchronous
    }

    @Override
    public String getId() {
	return sessionId;
    }

}
